<!doctype html>
<script src="../../../resources/testharness.js"></script>
<script src="../../../resources/testharnessreport.js"></script>
<p>This tests moving the caret forward through content of mixed editability.
The caret should move down one line from the editable piece to the editable
piece that's embedded in a non-editable piece.</p>
<div contenteditable id="sample">
editable1
<table border="1" contenteditable="false">
<tr><td contenteditable id="anchor">editable2</td></tr>
</table>
editable3
</div>
<div id="log"></div>
<script>
test(function() {
    var selection = window.getSelection();
    selection.collapse(document.getElementById('sample'), 0);
    selection.modify('move', 'forward', 'line');

    var anchor = document.getElementById('anchor').firstChild;
    assert_equals(selection.anchorNode, anchor, 'anchorNode');
    assert_equals(selection.anchorOffset, 0, 'anchorOffset');
    assert_equals(selection.focusNode, anchor, 'focusNode');
    assert_equals(selection.focusOffset, 0, 'focusOffset');
}, 'skip over uneditable part');
</script>
